package cn.dev8.util

fun String.fillWithPad(  length:Int ,pad:Char):String{
    if (this.length >= length) return this
    return this + getPadWithLength(length - this.length, pad)
}

private fun getPadWithLength(length: Int, pad: Char): String {
    val ret = StringBuilder()
    for (i in 0 until length) {
        ret.append(pad)
    }
    return ret.toString()
}